layui.use(['form','layer'],function () {
    $ = layui.jquery;
    var form = layui.form,
        layer = layui.layer;



    form.on('submit(add)', function () {

        $.ajax({
            url:'/sharepark/user/addCommunity',
            type: 'post',
            dataType: 'json',
            data: {
                'lAccount': $("#account").val(),
                'lPassword': $("#pwd").val()
            },
            success: function (res) {
                layer.msg(res.msg,{time:3000});
                if (res.msg==='添加物业成功') {

                    parent.location.replace("/sharepark/index.html");
                }else {

                 location.reload();
                }
            }


        });
        return false;
    })

})
